using System;
using System.Collections.Generic;

namespace SmartBoard.Book.Model
{
    public class Book
    {
        public Book()
        {
            this.Pages = new PageCollection();
        }

        public string Name { get; set; }
        public BookFormat Format { get; internal set; }
        public List<string> Authors { get; set; }
        public DateTime CreationDatetime;
        public PageCollection Pages { get; private set; }

        public bool IsEmpty
        {
            get
            {
                if (this.Pages == null)
                    return true;
                if (this.Pages.Count == 0)
                    return true;
                foreach (var page in Pages)
                {
                    if (!page.IsEmpty)
                        return false;
                }
                return true;
            }
        }

        public string Location { get; set; }
    }
}